<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: D:/Projects/MiXiM/extsrc/mixim/src/modules/analogueModel/UWBIRIEEE802154APathlossModel.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00406.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">UWBIRIEEE802154APathlossModel.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode:c++ -*- ********************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> * file:        UWBIRIEEE802154APathlossModel.h</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * author:      Jerome Rousselot &lt;jerome.rousselot@csem.ch&gt;</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * copyright:   (C) 2008-2009 Centre Suisse d&#39;Electronique et Microtechnique (CSEM) SA</span>
<a name="l00007"></a>00007 <span class="comment"> *        Systems Engineering</span>
<a name="l00008"></a>00008 <span class="comment"> *              Real-Time Software and Networking</span>
<a name="l00009"></a>00009 <span class="comment"> *              Jaquet-Droz 1, CH-2002 Neuchatel, Switzerland.</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> *              This program is free software; you can redistribute it</span>
<a name="l00012"></a>00012 <span class="comment"> *              and/or modify it under the terms of the GNU General Public</span>
<a name="l00013"></a>00013 <span class="comment"> *              License as published by the Free Software Foundation; either</span>
<a name="l00014"></a>00014 <span class="comment"> *              version 2 of the License, or (at your option) any later</span>
<a name="l00015"></a>00015 <span class="comment"> *              version.</span>
<a name="l00016"></a>00016 <span class="comment"> *              For further information see file COPYING</span>
<a name="l00017"></a>00017 <span class="comment"> *              in the top level directory</span>
<a name="l00018"></a>00018 <span class="comment"> * description: this AnalogueModel implements the IEEE 802.15.4A Channel Model</span>
<a name="l00019"></a>00019 <span class="comment"> ***************************************************************************/</span>
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef _UWBIRIEEE802154APATHLOSSMODEL_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define _UWBIRIEEE802154APATHLOSSMODEL_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;MiXiMDefs.h&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;AnalogueModel.h&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;SimpleTimeConstMapping.h&quot;</span>
<a name="l00027"></a>00027 
<a name="l00057"></a><a class="code" href="a00222.html">00057</a> <span class="keyword">class </span>MIXIM_API <a class="code" href="a00222.html" title="This class implements the IEEE 802.15.4A Channel Model[1] in the MiXiM omnet++ modeling framework...">UWBIRIEEE802154APathlossModel</a> : <span class="keyword">public</span> <a class="code" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a> {
<a name="l00058"></a>00058 <span class="keyword">private</span>:
<a name="l00061"></a>00061   <a class="code" href="a00222.html" title="This class implements the IEEE 802.15.4A Channel Model[1] in the MiXiM omnet++ modeling framework...">UWBIRIEEE802154APathlossModel</a>(<span class="keyword">const</span> <a class="code" href="a00222.html" title="This class implements the IEEE 802.15.4A Channel Model[1] in the MiXiM omnet++ modeling framework...">UWBIRIEEE802154APathlossModel</a>&amp;);
<a name="l00064"></a>00064   <a class="code" href="a00222.html" title="This class implements the IEEE 802.15.4A Channel Model[1] in the MiXiM omnet++ modeling framework...">UWBIRIEEE802154APathlossModel</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="a00222.html" title="This class implements the IEEE 802.15.4A Channel Model[1] in the MiXiM omnet++ modeling framework...">UWBIRIEEE802154APathlossModel</a>&amp;);
<a name="l00065"></a>00065 
<a name="l00066"></a>00066 <span class="keyword">public</span>:
<a name="l00067"></a>00067 
<a name="l00068"></a>00068   <span class="comment">/*</span>
<a name="l00069"></a>00069 <span class="comment">   * @brief Default constructor.</span>
<a name="l00070"></a>00070 <span class="comment">   */</span>
<a name="l00071"></a>00071   <a class="code" href="a00222.html" title="This class implements the IEEE 802.15.4A Channel Model[1] in the MiXiM omnet++ modeling framework...">UWBIRIEEE802154APathlossModel</a>()
<a name="l00072"></a>00072     : <a class="code" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a>()
<a name="l00073"></a>00073     , channelModel(0)
<a name="l00074"></a>00074     , cfg()
<a name="l00075"></a>00075     , tapThreshold(0)
<a name="l00076"></a>00076     , doShadowing(<span class="keyword">false</span>)
<a name="l00077"></a>00077     , doSmallScaleShadowing(<span class="keyword">false</span>)
<a name="l00078"></a>00078     , newTxPower(NULL)
<a name="l00079"></a>00079     , txPower(NULL)
<a name="l00080"></a>00080     , arg()
<a name="l00081"></a>00081     , pulsesIter(NULL)
<a name="l00082"></a>00082     , L(0)
<a name="l00083"></a>00083     , S(0)
<a name="l00084"></a>00084     , clusterStart()
<a name="l00085"></a>00085     , gamma_l()
<a name="l00086"></a>00086     , Mcluster(0)
<a name="l00087"></a>00087     , Omega_l(0)
<a name="l00088"></a>00088     , averagePower(0)
<a name="l00089"></a>00089     , nbCalls(0)
<a name="l00090"></a>00090     , averagePowers()
<a name="l00091"></a>00091     , pathlosses()
<a name="l00092"></a>00092     {
<a name="l00093"></a>00093       averagePowers.setName(<span class="stringliteral">&quot;averagePower&quot;</span>);
<a name="l00094"></a>00094       pathlosses.setName(<span class="stringliteral">&quot;pathloss&quot;</span>);
<a name="l00095"></a>00095     }
<a name="l00096"></a>00096 
<a name="l00105"></a>00105     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a9c52493cdf1baa4110a83869e8bc13c5" title="Initialize the analog model from XML map data.">initFromMap</a>(<span class="keyword">const</span> <a class="code" href="a00009.html#ab1820eb5285a02a2464be54ec651feab" title="Used at initialization to pass the parameters to the AnalogueModel and Decider.">ParameterMap</a>&amp;);
<a name="l00106"></a>00106 
<a name="l00107"></a>00107     <span class="keyword">virtual</span> ~<a class="code" href="a00222.html" title="This class implements the IEEE 802.15.4A Channel Model[1] in the MiXiM omnet++ modeling framework...">UWBIRIEEE802154APathlossModel</a>() {}
<a name="l00108"></a>00108 
<a name="l00109"></a>00109     <span class="comment">/*</span>
<a name="l00110"></a>00110 <span class="comment">     * @brief Applies the model to an incoming AirFrame&#39;s Signal.</span>
<a name="l00111"></a>00111 <span class="comment">     */</span>
<a name="l00112"></a>00112     <span class="keywordtype">void</span> <a class="code" href="a00009.html#a3242bc36a68dab53551d4ab1f1dab010" title="Has to be overriden by every implementation.">filterSignal</a>(airframe_ptr_t, <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>&amp;, <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>&amp;);
<a name="l00113"></a>00113 
<a name="l00114"></a>00114     <span class="comment">/*@brief Utility function to use a Rayleigh random variable</span>
<a name="l00115"></a>00115 <span class="comment">     *</span>
<a name="l00116"></a>00116 <span class="comment">     */</span>
<a name="l00117"></a>00117     <span class="keywordtype">double</span> Rayleigh(<span class="keywordtype">double</span> param);
<a name="l00118"></a>00118 
<a name="l00119"></a>00119     <span class="comment">/* @brief Lists implemented channel models.</span>
<a name="l00120"></a>00120 <span class="comment">     * */</span>
<a name="l00121"></a>00121     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> implemented_CMs[];
<a name="l00122"></a>00122 
<a name="l00123"></a><a class="code" href="a00047.html">00123</a>     <span class="keyword">struct </span><a class="code" href="a00047.html">CMconfig</a> {
<a name="l00124"></a>00124       <span class="keywordtype">double</span> PL0;         <span class="comment">// pathloss at 1 m distance (*not* in dB)</span>
<a name="l00125"></a>00125       <span class="keywordtype">double</span> n;         <span class="comment">// pathloss exponent</span>
<a name="l00126"></a>00126       <span class="keywordtype">double</span> sigma_s;       <span class="comment">// shadowing standard deviation (unused)</span>
<a name="l00127"></a>00127       <span class="keywordtype">double</span> Aant;        <span class="comment">// antenna loss (always 3 dB)</span>
<a name="l00128"></a>00128       <span class="keywordtype">double</span> kappa;       <span class="comment">// frequency dependence of the pathloss</span>
<a name="l00129"></a>00129     <span class="keywordtype">double</span> Lmean;       <span class="comment">// mean number of clusters</span>
<a name="l00130"></a>00130       <span class="keywordtype">double</span> Lambda;          <span class="comment">// inter-cluster arrival rate (clusters *per second*)</span>
<a name="l00131"></a>00131     <span class="comment">// ray arrival rates (mixed Poisson model parameters, in seconds)</span>
<a name="l00132"></a>00132       <span class="keywordtype">double</span> lambda_1, lambda_2, Beta;
<a name="l00133"></a>00133       <span class="keywordtype">double</span> Gamma;       <span class="comment">// inter-cluster decay constant</span>
<a name="l00134"></a>00134       <span class="keywordtype">double</span> k_gamma, gamma_0;  <span class="comment">// intra-cluster decay time constant parameters</span>
<a name="l00135"></a>00135       <span class="keywordtype">double</span> sigma_cluster;   <span class="comment">// cluster shadowing variance (*not* in dB)</span>
<a name="l00136"></a>00136       <span class="keywordtype">double</span> m_0, k_m;      <span class="comment">// Nakagami m factor mean</span>
<a name="l00137"></a>00137       <span class="keywordtype">double</span> var_m_0, var_k_m;  <span class="comment">// Nakagami m factor variance</span>
<a name="l00138"></a>00138       <span class="keywordtype">double</span> strong_m_0;      <span class="comment">// Nakagami m factor for strong components</span>
<a name="l00139"></a>00139       <span class="comment">// parameters for alternative PDP shape</span>
<a name="l00140"></a>00140       <span class="keywordtype">double</span> gamma_rise; <span class="keywordtype">double</span> gamma_1; <span class="keywordtype">double</span> xi;
<a name="l00141"></a>00141     };
<a name="l00142"></a>00142 
<a name="l00143"></a>00143     <span class="comment">/* @brief Known models configuration</span>
<a name="l00144"></a>00144 <span class="comment">     **/</span>
<a name="l00145"></a>00145     <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="a00047.html">CMconfig</a> CMconfigs[];
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 
<a name="l00148"></a>00148 <span class="keyword">protected</span>:
<a name="l00149"></a>00149 
<a name="l00152"></a><a class="code" href="a00222.html#a725ed7982be7b05533473705224fb14f">00152</a>   <span class="keywordtype">int</span> <a class="code" href="a00222.html#a725ed7982be7b05533473705224fb14f" title="selected channel model">channelModel</a>;
<a name="l00153"></a>00153 
<a name="l00154"></a>00154   <span class="comment">/* @brief Selected configuration</span>
<a name="l00155"></a>00155 <span class="comment">       **/</span>
<a name="l00156"></a>00156       <a class="code" href="a00047.html">CMconfig</a> cfg;
<a name="l00157"></a>00157 
<a name="l00158"></a>00158     <span class="comment">// configure cluster threshold</span>
<a name="l00159"></a>00159     <span class="keywordtype">double</span> tapThreshold; <span class="comment">// Only generates taps with at most 10 dB attenuation</span>
<a name="l00160"></a>00160 
<a name="l00161"></a>00161     <span class="keywordtype">double</span> doShadowing; <span class="comment">//activates block shadowing</span>
<a name="l00162"></a>00162     <span class="keywordtype">double</span> doSmallScaleShadowing; <span class="comment">// activates small-scale shadowing</span>
<a name="l00163"></a>00163 
<a name="l00164"></a>00164     <span class="comment">// channel statistical characterization parameters</span>
<a name="l00165"></a>00165     <span class="comment">// (should be xml-ized)</span>
<a name="l00166"></a>00166     <span class="comment">// First environment: Residential LOS</span>
<a name="l00167"></a>00167     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> PL0; <span class="comment">// -43.9 dB</span>
<a name="l00168"></a>00168     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> pathloss_exponent;
<a name="l00169"></a>00169     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> meanL;
<a name="l00170"></a>00170     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> Lambda;
<a name="l00171"></a>00171     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> lambda1;
<a name="l00172"></a>00172     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> lambda2;
<a name="l00173"></a>00173     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> Beta;
<a name="l00174"></a>00174     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> Gamma;
<a name="l00175"></a>00175     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> k_gamma;
<a name="l00176"></a>00176     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> gamma_0;
<a name="l00177"></a>00177     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> sigma_cluster; <span class="comment">// 2.75 dB</span>
<a name="l00178"></a>00178 
<a name="l00179"></a>00179     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> fc; <span class="comment">// mandatory band 3, center frequency, Hz</span>
<a name="l00180"></a>00180     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> BW;  <span class="comment">//  mandatory band 3, bandwidth, Hz</span>
<a name="l00181"></a>00181     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> fcMHz; <span class="comment">// mandatory band 3, center frequency, MHz</span>
<a name="l00182"></a>00182 
<a name="l00183"></a>00183     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> d0;
<a name="l00184"></a>00184 
<a name="l00185"></a>00185     <span class="comment">// antenna parameters</span>
<a name="l00186"></a>00186     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> ntx;
<a name="l00187"></a>00187     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> nrx;
<a name="l00188"></a>00188 
<a name="l00189"></a>00189     <a class="code" href="a00212.html">TimeMapping&lt;Linear&gt;</a>* newTxPower;
<a name="l00190"></a>00190     <a class="code" href="a00058.html" title="Represents a not changeable mapping (mathematical function) from domain with at least the time to a A...">ConstMapping</a>* txPower;
<a name="l00191"></a>00191     <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a> arg;
<a name="l00192"></a>00192     <a class="code" href="a00137.html" title="Defines an iterator for a Mapping which is able to iterate over the Mapping.">MappingIterator</a>* pulsesIter;
<a name="l00193"></a>00193     <span class="comment">// number of clusters</span>
<a name="l00194"></a>00194     <span class="keywordtype">double</span> L;
<a name="l00195"></a>00195     <span class="comment">// block shadowing</span>
<a name="l00196"></a>00196     <span class="keywordtype">double</span> S;
<a name="l00197"></a>00197     <span class="comment">// start time of cluster number &quot;cluster&quot;</span>
<a name="l00198"></a>00198     simtime_t clusterStart;
<a name="l00199"></a>00199     simtime_t gamma_l;
<a name="l00200"></a>00200     <span class="keywordtype">double</span> Mcluster;
<a name="l00201"></a>00201     <span class="comment">// cluster integrated energy</span>
<a name="l00202"></a>00202     <span class="keywordtype">double</span> Omega_l;
<a name="l00203"></a>00203 
<a name="l00204"></a>00204     <span class="keywordtype">double</span> averagePower; <span class="comment">// statistics counter (useful for model validation, should converges towards 1)</span>
<a name="l00205"></a>00205     <span class="keywordtype">long</span> nbCalls;
<a name="l00206"></a>00206     cOutVector averagePowers;
<a name="l00207"></a>00207     cOutVector pathlosses;  <span class="comment">// outputs computed pathlosses. Allows to compute Eb = Epulse*pathloss for Eb/N0 computations. (N0 is the noise sampled by the receiver)</span>
<a name="l00208"></a>00208 
<a name="l00209"></a>00209     <span class="comment">/*</span>
<a name="l00210"></a>00210 <span class="comment">     * Generates taps for the considered pulse, with the current channel parameters</span>
<a name="l00211"></a>00211 <span class="comment">     */</span>
<a name="l00212"></a>00212     <span class="keywordtype">void</span> addEchoes(simtime_t_cref pulseStart);
<a name="l00213"></a>00213 
<a name="l00214"></a>00214     <span class="comment">/*</span>
<a name="l00215"></a>00215 <span class="comment">     * @brief Computes the pathloss as a function of center frequency and bandwidth given in MHz</span>
<a name="l00216"></a>00216 <span class="comment">     */</span>
<a name="l00217"></a>00217     <span class="keywordtype">double</span> getPathloss(<span class="keywordtype">double</span> fc, <span class="keywordtype">double</span> BW, <span class="keywordtype">double</span> distance) <span class="keyword">const</span>;
<a name="l00218"></a>00218 
<a name="l00219"></a>00219 };
<a name="l00220"></a>00220 
<a name="l00221"></a>00221 <span class="preprocessor">#endif  </span><span class="comment">/* _UWBIRIEEE802154APATHLOSSMODEL_H */</span>
<a name="l00222"></a>00222 
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>UWBIRIEEE802154APathlossModel.h</b>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:30 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
